package cn.juque.lucenecandy.core.base;

import cn.hutool.core.util.ClassUtil;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.apache.lucene.search.SortField;

/**
 * @author juque
 * @version 1.0.0
 * <ul>
 *     <li>QueryWrapperBuilder</li>
 * </ul>
 * @date 2023-12-26
 **/
@Slf4j
@ToString
public class CountQueryWrapperBuilder<T extends BaseEntity> extends AbstractBuilder<T, CountQueryWrapperBuilder<T>> {

    public CountQueryWrapperBuilder(Class<T> clazz) {
        super(clazz);
        super.thisType = this;
    }

    @Override
    public CountQueryWrapperBuilder<T> addSort(Sfunction<T, ?> sfunction, SortField.Type type, Boolean reverse) {
        return super.thisType;
    }

    @Override
    public CountQueryWrapper build() {
        return new CountQueryWrapper(
                ClassUtil.getClassName(super.indexClass, false), super.indexInfo, super.queryMap);
    }
}
